package es.uji.viselab.benchmark;

import es.uji.viselab.benchmark.database.DBConnection;
import es.uji.viselab.image.source.ImageListener;
import es.uji.viselab.image.source.ImageSource;
import es.uji.viselab.math.Matrix4;
import es.uji.viselab.math.Vector3;
import es.uji.viselab.robot.Robot;
import es.uji.viselab.robot.RobotListener;
import es.uji.viselab.visualservoing.VisualServoingListener;

public class BenchMarkingRecorder implements ImageListener, VisualServoingListener,RobotListener {
	private DBConnection database;
	
	
	public BenchMarkingRecorder() {
		// TODO Auto-generated constructor stub
	}
	public DBConnection getDatabase() {
		return database;
	}
	public void setDatabase(DBConnection database) {
		this.database = database;
	}
	
	@Override
	public void newPositionRequested() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void cameraFeaturePointsChanged(ImageSource i) {
		//DataPackage dataNetworl;
		//database.insert(dataNetwork);
		
	}
	@Override
	public void robotPositionChanged(Robot robot) {
		Matrix4 pose = robot.getPoseM();
		Vector3 eep =  pose.getEndEffectorPose();
		DataPackage dp= new DataPackage(DataPackageType.XYZ_END_EFFECTOR, eep.x, eep.y,eep.z);
		database.insert(dp);
	}

	@Override
	public void robotCreated(Robot robot) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void robotConnected(Robot robot) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void robotDisconnected() {
		// TODO Auto-generated method stub
		
	}
	
	
}
